<%@ page language="java" contentType="text/html; charset=UTF-8"
	pageEncoding="UTF-8"%>
<%@ taglib uri="http://java.sun.com/jsp/jstl/core" prefix="c"%>
<!DOCTYPE html>
<html lang="en">
	<head>
		<title>Unicorn Admin</title>
		<meta charset="UTF-8" />
        <meta name="viewport" content="width=device-width, initial-scale=1.0" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/bootstrap-min.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/bootstrap-responsive.min.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/fullcalendar.css" />	
		<link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/unicorn.main.css" />
		<link rel="stylesheet" href="${pageContext.request.contextPath}/dist/css/unicorn.grey.css" class="skin-color" />
	<meta http-equiv="Content-Type" content="text/html; charset=utf-8" /></head>
	<body>	
		<div id="header">
			<h1><a href="./dashboard.html">独角兽管理员</a></h1>		
		</div>	
		<div id="user-nav" class="navbar navbar-inverse">
            <ul class="nav btn-group">
                
                   <!-- 默认头像 -->
					<li><img src="${pageContext.request.contextPath}/dist/img/0.jpg"
					     style="border-radius:50%;width:30px;height:30px;margin-top:0px;"/></li>
					
                <li><a href="#">${sessionScope.users.adminAccount }</a></li>
                <li class="btn btn-inverse"><a title="" href="${pageContext.request.contextPath}/EduControllerByGyx?op=addminExit"><i class="icon icon-share-alt"></i> <span class="text">退出</span></a></li>
            </ul>
        </div>
            
		<div id="sidebar">
			<a href="#" class="visible-phone"><i class="icon icon-home"></i> 首页</a>
			<ul>
				<li class="active"><a href="${pageContext.request.contextPath}/mvc/index.jsp"><i class="icon icon-home"></i> <span>首页</span></a></li>
				<li class="submenu">
					<a href="#"><i class="icon icon-th-list"></i> <span>管理员事项</span> <span class="label">2</span></a>
					<ul>
						<li><a href="${pageContext.request.contextPath}/mvc/form-validation.jsp">管理员列表</a></li>
						<li><a href="${pageContext.request.contextPath}/mvc/form-addadmin.jsp">添加管理员</a></li>
					</ul>
				</li>
				<li class="submenu">
					<a href="#"><i class="icon icon-th-list"></i> <span>详细数据表</span> <span class="label">2</span></a>
					<ul>
						<li><a href="${pageContext.request.contextPath}/mvc/userstable.jsp">用户列表</a></li>
						<li><a href="${pageContext.request.contextPath}/mvc/articletable.jsp">文章列表</a></li>
					</ul>
				</li>
				<li>
					<a href="${pageContext.request.contextPath}/mvc/charts.jsp"><i class="icon icon-signal"></i> <span>数据信息统计</span></a>
				</li>		
			</ul>
		
		</div>
		
		<div id="style-switcher">
			<i class="icon-arrow-left icon-white"></i>
			<span>Style:</span>
			<a href="#grey" style="background-color: #555555;border-color: #aaaaaa;"></a>
			<a href="#blue" style="background-color: #2D2F57;"></a>
			<a href="#red" style="background-color: #673232;"></a>
		</div>
		
		<div id="content">
			<div id="content-header">
				<h1>EduSystem系统</h1>
				<!-- <div class="btn-group">
					<a class="btn btn-large tip-bottom" title="Manage Files"><i class="icon-file"></i></a>
					<a class="btn btn-large tip-bottom" title="Manage Users"><i class="icon-user"></i></a>
					<a class="btn btn-large tip-bottom" title="Manage Comments"><i class="icon-comment"></i><span class="label label-important">5</span></a>
					<a class="btn btn-large tip-bottom" title="Manage Orders"><i class="icon-shopping-cart"></i></a>
				</div> -->
			</div>
			<div id="breadcrumb">
				<a href="#" title="Go to Home" class="tip-bottom"><i class="icon-home"></i> 首页</a>
			</div>
			<div class="container-fluid">
				</div>
				<div class="row-fluid">
					<div class="span12">
						<div class="alert alert-info">
							尊敬的 <strong>${sessionScope.users.adminAccount }</strong>管理员 欢迎进入EduSystem管理系统,祝你工作顺利!
							<a href="#" data-dismiss="alert" class="close">×</a>
						</div>
						<div class="widget-box">
							<div class="widget-title"><span class="icon"><i class="icon-signal"></i></span><h5>站点统计</h5><div class="buttons"><a href="#" class="btn btn-mini"><i class="icon-refresh"></i>刷新</a></div></div>
							<div class="widget-content">
								<div class="row-fluid">
								<div class="span4">
									<ul class="site-stats">
										<li><i class="icon-user"></i> <strong id="allUsers"></strong> <small>注册总人数</small></li>
										<li><i class="icon-user"></i> <strong id="newUser"></strong> <small>今日新增注册人数</small></li>
										<li class="divider"></li>
										<li><i class="icon-file"></i> <strong id="allAtircles"></strong> <small>文章总量</small></li>
										<li><i class="icon-file"></i> <strong id="newAtircles"></strong> <small>今日新增文章数</small></li>
										<li><i class="icon-repeat"></i> <strong>29</strong> <small>Pending Orders</small></li>
									</ul>
								</div>
								<div class="span8">
									<div class="chart">
									<!-- 尝试用图标 -->
									
									</div> 
								</div>	
								</div>							
							</div>
						</div>					
					</div>
				</div>
				<div class="row-fluid">
					<div class="span6">
						<div class="widget-box">
							<div class="widget-title"><span class="icon"><i class="icon-file"></i></span><h5>最新文章</h5><span title="more" class="label label-info tip-left"><a href ="${pageContext.request.contextPath}/mvc/articletable.jsp">更多</a></span></div>
							<div class="widget-content nopadding">
								<ul class="recent-posts" id="newArticles">

								</ul>
							</div>
						</div>
					</div>
					<div class="span6">
						<div class="widget-box">
							<div class="widget-title"><span class="icon"><i class=" icon-user"></i></span><h5>最新注册用户</h5><span title="more" class="label label-info tip-left"><a href ="${pageContext.request.contextPath}/mvc/userstable.jsp">更多</a></span></div>
							<div class="widget-content nopadding">
								<ul class="recent-comments" id="newUsers">
								
								</ul>
							</div>
						</div>
					</div>
				</div>
				<div class="row-fluid">
					<div id="footer" class="span12">
						2012 &copy; Unicorn Admin. Brought to you by <a href="https://wrapbootstrap.com/user/diablo9983">diablo9983</a>
					</div>
				</div>
			</div>
           
	</body>
	        <script src="${pageContext.request.contextPath}/dist/js/excanvas.min.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/jquery.min.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/jquery.ui.custom.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/bootstrap-min.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/jquery.flot.min.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/jquery.flot.resize.min.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/jquery.peity.min.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/fullcalendar.min.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/unicorn.js"></script>
            <script src="${pageContext.request.contextPath}/dist/js/unicorn.dashboard.js"></script>
            <!-- 引入 echarts.js -->
            <script src="https://cdn.staticfile.org/echarts/4.3.0/echarts.min.js"></script>
	 <script>
	 $(function(){
		 //获取前三天新更新文章
		$.get("${pageContext.request.contextPath}/EduControllerByLu",{op:"queryArticlesFor5"},function(data){
			$("#newArticles").empty();
			$.each(data,function(n,article){
				var aa=article.articleContent;
				aa = aa.replace(/(\n)/g, "");    
				aa = aa.replace(/(\t)/g, "");    
				aa = aa.replace(/(\r)/g, "");    
				aa = aa.replace(/<\/?[^>]*>/g, "");    
				aa = aa.replace(/\s*/g, "");  
				$("#newArticles").append("<li>\r\n" + 	
						"<div class=\'article-post\'>\r\n" + 
						"<span class=\'user-info\'> By: "+article.articleTitle+", 用户: "+article.users.userAccount+"</span>\r\n" + 
						"<p white-space: nowrap; text-overflow: ellipsis; overflow: hidden>\r\n" + 
						"<a href=\'#\'>"+aa+"</a>\r\n" + 
						"</p>\r\n" +  
						"</div>\r\n" + 
						"</li>");
			})
		},"json"); 
		 
		//显示user,article的总数量与新增数
		 $.post("${pageContext.request.contextPath}/EduControllerByLu",{op:"queryCount"},function(result){
			 $("#allUsers").text(result.allUsers);
			 $("#newUser").text(result.newUsers);
			 $("#allAtircles").text(result.allArticles);
			 $("#newAtircles").text(result.newArticles);
		 },"json");
	     
		//获取前几的新注册用户
		 $.get("${pageContext.request.contextPath}/EduControllerByGyx",
					{op:"querytopUsers"},
				    function(data){
				     $("#newUsers").empty();
				     //遍历
				     $.each(data,function(n,users){
					 $("#newUsers").append("<li>\r\n" + 
							"<div class=\"comments\">\r\n" + 
							"<span class=\"user-info\"> 账号: "+users.userAccount +" 注册时间:"+ users.userDate.substring(0,users.userDate.length-2)+"</span>\r\n" + 										
							"</div>\r\n" + 
							"</li>");
				})
			},"json"); 
	 });
	 
     
	 
	 </script>
	 <style>
	 audio, canvas, video {
    display: none;
}

element.style {
    color: white;
}

.chart .tickLabels div{
color:white;
}
.chart .legend table{
display: none;
 color: white;
}
#mainecharts{

}
.label label-info tip-left a{
color:white;
}

	 </style>
</html>
